<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
        <meta name="description" content="" />
        <meta name="author" content="" />
        <title>Dashboard - Admin</title>
        <link href="{{.cdn}}/admin/css/styles.css" rel="stylesheet" />
        <script src="{{.cdn}}/admin/js/all.min.js" crossorigin="anonymous"></script>
    </head>
    <body class="sb-nav-fixed">
        <nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
            <!-- Navbar Brand-->
            <a class="navbar-brand ps-3" href="/admin">柚子吧</a>
            <!-- Sidebar Toggle-->
            <button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
            <!-- Navbar Search-->
            <form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
                <div class="input-group">
                    <input class="form-control" type="text" placeholder="Search for..." aria-label="Search for..." aria-describedby="btnNavbarSearch" />
                    <button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
                </div>
            </form>
            <!-- Navbar-->
            <ul class="navbar-nav ms-md-0 me-3 me-lg-4">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                        <li><a class="dropdown-item" href="#!">Settings</a></li>
                        <li><hr class="dropdown-divider" /></li>
                        <li><a class="dropdown-item" href="#!">Logout</a></li>
                    </ul>
                </li>
            </ul>
        </nav>
        <div id="layoutSidenav">
            <div id="layoutSidenav_nav">
                <nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
                    <div class="sb-sidenav-menu">
                        <div class="nav">
                            <div class="sb-sidenav-menu-heading">Core</div>
                            <a class="nav-link" href="/admin">
                                <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                                文章列表
                            </a>
                            <a class="nav-link" href="/admin/page">
                                <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                                页面列表
                            </a>
                            <a class="nav-link" href="/admin/category">
                                <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                                分类列表
                            </a>
                            <a class="nav-link" href="/admin/tag">
                                <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                                标签列表
                            </a>
                            <a class="nav-link" href="/admin/visitlog">
                                <div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
                                访问日志列表
                            </a>
                        </div>
                    </div>
                </nav>
            </div>
            <div id="layoutSidenav_content">
                <main>
                    <div class="container-fluid px-4">
                        <h1 class="mt-4">页面列表</h1>
                       
                        <div class="card mb-4">
                            <div class="card-header">
                                <a class="navbar-brand" href="/admin/page/add">添加页面</a>
                            </div>
                            <div class="card-body">
                                <table id="datatablesSimple">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>标题</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {{range .pages}}
                                        <tr>
                                            <td>{{.Id}}</td>
                                            <td>{{.Title}}</td>
                                            <td><a href="/admin/page/add?id={{.Id}}">编辑</a>|<a href="/admin/page/delete?id={{.Id}}">删除</a></td>
                                        </tr>
                                        {{end}}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </main>
            </div>
        </div>
        <script src="{{.cdn}}/admin/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
        <script src="{{.cdn}}/admin/js/scripts.js"></script>
        <script src="{{.cdn}}/admin/js/simple-datatables.js" crossorigin="anonymous"></script>
        <script src="{{.cdn}}/admin/js/datatables-simple-demo.js"></script>
    </body>
</html>
